﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Gufa.Entity.Configs
{
    public class ResponsibilityConfig : IEntityTypeConfiguration<Responsibility>
    {
        public void Configure(EntityTypeBuilder<Responsibility> builder)
        {
            builder.ToTable("T_Responsibilities");
            builder.Property(r => r.Content).IsRequired();
            builder.ToTable(tb => tb.HasCheckConstraint("CK_DelFlag_Values", "DelFlag IN (0, 1)"));
            builder.HasOne(r => r.Experience).WithMany(e => e.Responsibilities).HasForeignKey(r => r.ExperienceId);
        }
    }
}
